<!DOCTYPE html>
<html>
    <head>
        <title>全景通-安装程序</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=100"/>
        <link href="__PUBLIC__/install/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="__PUBLIC__/install/jquery.js"></script>
        <script type="text/javascript" src="__PUBLIC__/common/js/common.js"></script>
        <script type="text/javascript">
            function TestDb() {
                $.ajax({
                    url: "{:U('install/index/testdb')}",
                    type: "POST",
                    data: {step: 10, db_h: $("#dbhost").val(), db_u: $("#dbuser").val(), db_p: $("#dbpwd").val()},
                    beforeSend: function(data) {
                        $("#dbpwdsta").html("验证中...");
                    },
                    success: function(data) {
                        $("#dbpwdsta").html(data);
                        HaveDB();
                    }
                });
            }
            function HaveDB() {
                $.ajax({
                    url: "{:U('install/index/havedb')}",
                    type: "POST",
                    data: {step: 11, db_h: $("#dbhost").val(), db_u: $("#dbuser").val(), db_p: $("#dbpwd").val(), dbname: $("#dbname").val()},
                    beforeSend: function(data) {
                        $("#havedbsta").html("验证中...");
                    },
                    success: function(data) {
                        $("#havedbsta").html(data);
                    }
                });
            }

        </script>
    </head>
    <body>
        <div id="toper"></div>
        <form action="" method="post" name="form1" onsubmit="return checksb();">
            <input type="hidden" name="step" value="4" />
            <input type="hidden" id="door" name="door" value="0" />
            <input type="hidden" id="locker" name="locker" value="0" />
            <div id="main">
                <div class="printer">
                    <div class="printer_title">数据库设定</div>
                    <div class="printer_body">
                        <table width="860" border="0" align="center" cellpadding="0" cellspacing="0" class="twbox">
                            <tr height="36">
                                <td class="onetd" width="25%"><strong>数据库主机：</strong></td>
                                <td width="75%"><input name="dbhost" id="dbhost" type="text" value="localhost" class="input-txt" />
                                    <small>一般为localhost</small>
                                </td>
                            </tr>
                            <tr  height="36">
                                <td class="onetd"><strong>数据库用户：</strong></td>
                                <td><input name="dbuser" id="dbuser" type="text" value="root" class="input-txt" /></td>
                            </tr>
                            <tr  height="36">
                                <td class="onetd"><strong>数据库密码：</strong></td>
                                <td>
                                    <input name="dbpwd" id="dbpwd" type="text" class="input-txt" onChange="TestDb();" /><span id='dbpwdsta'></span>
                                </td>
                            </tr>
                            <tr height="36">
                                <td class="onetd"><strong>数据表前缀：</strong></td>
                                <td><input name="dbprefix" id="dbprefix" type="text" value="pano_" class="input-txt" />
                                    <small>如无特殊需要,请不要修改</small></td>
                            </tr>
                            <tr height="36">
                                <td class="onetd"><strong>数据库名称：</strong></td>
                                <td>
                                    <input name="dbname" id="dbname" type="text" value="pano360vr" class="input-txt" onChange="HaveDB();" /><span id='havedbsta'></span>
                                </td>
                            </tr>
                            <tr height="36">
                                <td class="onetd"><strong>数据库编码：</strong></td>
                                <td>
                                    <input type="radio" name="dblang" id="dblang_utf8" value="utf8" checked="checked" /><label for="dblang_latin1">UTF8</label>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="printer_title">管理员初始密码</div>
                    <div class="printer_body">
                        <table width="860" border="0" align="center" cellpadding="0" cellspacing="0" class="twbox">
                            <tr height="36">
                                <td class="onetd"  width="25%"><strong>用户名：</strong></td>
                                <td  width="75%">
                                    <input name="adminuser" type="text" value="admin" class="input-txt" /><small>只能用'0-9'、'a-z'、'A-Z'、'.'、'@'、'_'、'-'、'!'以内范围的字符</small>
                                </td>
                            </tr>
                            <tr height="36">
                                <td class="onetd"><strong>密　码：</strong></td>
                                <td><input name="adminpwd" type="text" value="admin" class="input-txt" /></td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="submitbox">
                    <input name="cmspath" type="hidden" class="input-txt" value="{$basepath}" />
                    <input name="webname" type="hidden" value="全景通" class="input-txt" />
                    <input name="baseurl" type="hidden" value="{$baseurl}" class="input-txt" />

                    <input type="button" class="btn1" value="后退" onclick="window.location.href = '{:U('install/index/index?step=2')}';" />
                    <input type="submit" class="btn1" value="开始安装" />
                </div>
            </div>
        </form>
        <script type="text/javascript">
            TestDb();
        </script>
    </body>
</html>
